package Filter;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import logging.Record;

public class RegularExpressionFilter implements FilterStrategy{
	
    private String msgFilter;
    
    public RegularExpressionFilter(String msg) {
        this.msgFilter=msg;
    }


    public boolean apply(Record record) {
    	Pattern p = Pattern.compile(this.msgFilter);
       	Matcher m = p.matcher(record.getMessage());
        return (m.matches());
     
    }

}
